<?php

	class EbModule
	{
		var $module;
		
		public function __construct($module)
		{
			$this->module = $module;
		}
		
		public function update()
		{
			$listModelFiles = EbFilesToolkit::getFiles(MODULES_PATH.'/'.$this->module.'/m','/(.*)Model.php/');
			$log = '';
						
			foreach ($listModelFiles AS $file)
			{
				include_once($file);
				
				$file = EbFilesToolkit::getFilename($file);
				
				$reflectionClass = new ReflectionClass($file);
		
				if ($reflectionClass->hasMethod('create'))
				{
					$instance = $reflectionClass->newInstance();
												
					$log .= "Create $file Model: ".$instance->create().'<br />';
				}
			}
			
			return $log;
		}
	}